home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / prog / cport2.zip / XMODEM.H < prev   
C/C++ Source or Header  |  1993-04-09  |  2KB  |  95 lines

  1. /*
  2. // XMODEM.H
  3. //
  4. // Header file for Xmodem file transfer protocol
  5. //
  6. // Copyright (c) 1993 Bri Productions
  7. //
  8. */
  9.  
  10.  
  11. #ifndef  _XMODEM_H_
  12. #define  _XMODEM_H_
  13.  
  14. /*
  15. //-------------------------------------
  16. //
  17. // additional callback() error codes 
  18. //
  19. // ( lower 12 bits == ComError() )
  20. //
  21. //-------------------------------------
  22. */
  23. #define  XE_BADBLOCK    0x1000   /* Bad block            */
  24. #define  XE_BADCHECK    0x2000   /* Bad block check      */
  25. #define  XE_TIMEOUT     0x3000   /* Timeout              */
  26. #define  XE_CANCEL      0x4000   /* Canceled             */
  27.  
  28.  
  29. /*
  30. //-------------------------------------
  31. //
  32. // Return codes
  33. //
  34. //-------------------------------------
  35. */
  36. enum  {  
  37.          XR_NOERR,         /* No error                   */
  38.          XR_FILEERR,       /* File error                 */
  39.          XR_CANCEL,        /* Transfer canceled          */
  40.          XR_ALLOC,         /* Memory allocation          */
  41.          XR_USER           /* Start of user return codes */
  42.       };
  43.  
  44. /* 
  45. //-------------------------------------
  46. //
  47. // callback messages
  48. //
  49. //-------------------------------------
  50. */
  51. enum  {  
  52.          XM_IDLE,          /* Idle time               */
  53.          XM_START,         /* Starting transfer       */
  54.          XM_BLOCKCHECK,    /* Type of block check     */
  55.          XM_BLOCK,         /* New block               */
  56.          XM_EOT,           /* End of transmission     */
  57.          XM_DONE,          /* Transmission complete   */
  58.          XM_ERROR          /* Error                   */
  59.       };
  60.  
  61. /*
  62. //-------------------------------------
  63. //
  64. // callback messages parameter
  65. //
  66. //-------------------------------------
  67. */
  68. typedef unsigned XPARAM;
  69.  
  70.  
  71.  
  72.  
  73. /*
  74. //-------------------------------------
  75. //
  76. // Function prototypes
  77. //
  78. //-------------------------------------
  79. */
  80.  
  81. #ifdef __cplusplus
  82. extern "C" {
  83. #endif
  84.  
  85. int _Cdecl XmodemTx(COM com, const char* file, int (*cb)(int msg, XPARAM param));
  86. int _Cdecl XmodemRx(COM com, const char* file, int (*cb)(int msg, XPARAM param));
  87. int _Cdecl Xcallback(int msg, XPARAM param);
  88.  
  89. #ifdef __cplusplus
  90. }
  91. #endif
  92.  
  93. #endif   /* XMODEM.H */
  94.  
  95.